//
//  CustomView.m
//  10-homework
//
//  Created by dllo on 16/7/27.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CustomView.h"
#import "UIView+FrameChange.h"
@interface CustomView ()
@property (nonatomic, copy) NSString *imageName;
@property (nonatomic, copy) NSString *title;

@end

@implementation CustomView

- (instancetype)initWithFrame:(CGRect)frame imageName:(NSString *)imageName title:(NSString *)title {
    self = [super initWithFrame:frame];
    if (self) {
        _imageName = imageName;
        _title = title;
        [self creatsubView];
    }
    return self;
}

- (void)creatsubView {
    UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:_imageName]];
    imageView.backgroundColor = [UIColor redColor];
    imageView.frame = CGRectMake(5, 5, self.frame.size.width - 10, self.frame.size.height - 45);
    [self addSubview:imageView];
    UILabel *lable = [[UILabel alloc] initWithFrame:CGRectMake(5, 5 + imageView.cj_heigh + 5, self.frame.size.width - 10, 30)];
    lable.backgroundColor = [UIColor redColor];
    [self addSubview:lable];
}


@end
